package com.money.mvp_dagger_simple.presenter.module;

import com.money.mvp_dagger_simple.http.HttpUtil;
import com.money.mvp_dagger_simple.model.LoginModel;
import com.money.mvp_dagger_simple.model.reqparams.IRequestParams;
import com.money.mvp_dagger_simple.presenter.impl.ILoginPresenterImpl;
import com.money.mvp_dagger_simple.scope.ActivityScope;

import dagger.Module;
import dagger.Provides;

/**
 * Created by Money on 2017/8/28.
 */
@ActivityScope
@Module
public class LoginPresenterModule {

    private static final String TAG = LoginPresenterModule.class.getSimpleName();

    private ILoginPresenterImpl loginPresenter;

    public LoginPresenterModule(ILoginPresenterImpl presenter) {
        this.loginPresenter = presenter;
    }
    @ActivityScope
    @Provides
    ILoginPresenterImpl provideILoginPresenterImpl(){
        return loginPresenter;
    }

    //经测试由Module提供的构造方法中不能传递接口类型数据，必须是接口的实现类
    @ActivityScope
    @Provides
    LoginModel provideLoginModel(HttpUtil httpUtil, ILoginPresenterImpl presenter, IRequestParams requestParams){
        return new LoginModel(httpUtil, presenter, requestParams);
    }
}
